package 合唱团;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static int N = 60;
    static long[] a = new long[N];
    static long[][] f = new long[N][N];
    static long[][] g = new long[N][N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i] = in.nextLong();
        }
        int k = in.nextInt();
        int d = in.nextInt();
        for (int i = 1; i <= n; i++) {
            Arrays.fill(f[i], Long.MIN_VALUE);
            Arrays.fill(g[i], Long.MAX_VALUE);
            f[i][1] = g[i][1] = a[i];
        }
        for (int i = 2; i <= n; i++) {
            for (int j = 2; j <= Math.min(k, i); j++) {
                for (int l = Math.max(i - d, j - 1); l < i; l++) {
                    f[i][j] = Math.max(f[i][j], Math.max(f[l][j - 1] * a[i], g[l][j - 1] * a[i]));
                    g[i][j] = Math.min(g[i][j], Math.min(g[l][j - 1] * a[i], f[l][j - 1] * a[i]));
                }
            }
        }
        long res = Long.MIN_VALUE;
        for (int i = k; i <= n; i++) {
            res = Math.max(res, f[i][k]);
        }
        System.out.println(res);
    }
}
